trigger acct_dedup on Account bulk (before insert) {
 for (Account a : Trigger.new){
     if (a.Name != NULL)
           {
                 Account[] accounts= [select id from account where Name = :a.Name];
                 if (accounts.size() > 0) {
                       a.Name.addError('This Account cannot be created - Account Name already exists');
                 }    
           }
     }
}